class_name HoldInfinityBomb
extends BaseHoldItem

@onready var bomb_view: Node2D = $InfinityBomb
@export var throw_bomb_resource_name: String = "throw_bomb"


func use():
	var player = holder as Player
	
	var throw_bomb = (ResourceManager.get_resource(throw_bomb_resource_name) as PackedScene).instantiate() as ThrowBomb
	throw_bomb.dir = Vector2.from_angle(player.gun_hand.global_rotation) 
	throw_bomb.sender = player
	throw_bomb.item_config = item_data.item_config
	
	player.level.bullets_parent.add_child(throw_bomb)
	throw_bomb.global_position = bomb_view.global_position
	
